using UnityEngine;
// [Assembly-CSharp.dll].BeeCellular
public class BeeCellular : MonoBehaviour
{
    // Fields
    public int beeTotalInCell;
    public float genDelay;
    protected float currentGenDelay;
    private float genTimer;
    private int currentBeeTotal;
    public UnityEngine.GameObject beePrefabs;
    
    // Methods
    private void Start()
    {
        float val_1 = UnityEngine.Random.Range(minInclusive:  -0.5f, maxInclusive:  0.5f);
        val_1 = this.genDelay + val_1;
        this.currentGenDelay = val_1;
        var val_11 = 0;
        label_6:
        UnityEngine.Transform val_4 = this.transform;
        if(val_11 >= this.transform.childCount)
        {
            goto label_2;
        }
        
        val_4.GetChild(index:  0).gameObject.SetActive(value:  false);
        val_11 = val_11 + 1;
        if(this.transform != null)
        {
            goto label_6;
        }
        
        label_2:
        val_4.GetChild(index:  UnityEngine.PlayerPrefs.GetInt(key:  -1610599415)).gameObject.SetActive(value:  true);
    }
    private void Update()
    {
        if((mem[536886749] + 72) == 0)
        {
                return;
        }
        
        if(this.currentBeeTotal >= this.beeTotalInCell)
        {
                return;
        }
        
        float val_1 = UnityEngine.Time.deltaTime;
        val_1 = this.genTimer + val_1;
        this.genTimer = val_1;
        if(val_1 < this.currentGenDelay)
        {
                return;
        }
        
        this.genTimer = 0f;
        this.CreateNewBee();
    }
    private void CreateNewBee()
    {
        float val_10;
        int val_10 = this.currentBeeTotal;
        val_10 = val_10 + 1;
        this.currentBeeTotal = val_10;
        UnityEngine.Vector3 val_2 = this.transform.position;
        float val_11 = val_2.y;
        UnityEngine.Vector2 val_3 = UnityEngine.Random.insideUnitCircle;
        float val_4 = val_2.x * 0.5f;
        val_10 = 0f;
        val_10 = 0f;
        val_11 = val_11 + (val_2.y * 0.5f);
        val_4 = val_2.x + val_4;
        Unknown val_8 = UnityEngine.Object.Instantiate<System.Object>(original:  this.beePrefabs, position:  new UnityEngine.Vector3() {x = val_4, y = val_11, z = val_2.z + val_10}, rotation:  new UnityEngine.Quaternion() {x = mem[536891277], y = mem[536891277] + 4, z = mem[536891277] + 8, w = mem[536891277] + 8 + 4}).GetComponent<System.Object>();
        mem2[0] = 1;
        float val_9 = UnityEngine.Random.RandomRange(min:  -0.5f, max:  0.5f);
        val_9 = this.genDelay + val_9;
        this.currentGenDelay = val_9;
    }
    public BeeCellular()
    {
    
    }

}
